//
//  SEShareView.m
//  RealDoc
//
//  Created by 张洪 on 16/7/9.
//  Copyright © 2016年 Alphts. All rights reserved.
//

#import "SEShareView.h"

@interface SEShareView()<UITableViewDataSource,UITableViewDelegate>

@property (nonatomic, strong) NSArray *dataArray;

@end

@implementation SEShareView

-(NSArray *)dataArray{
    if (!_dataArray) {
        _dataArray = @[@"gt",@"gy",@"sj",@"xx",@"xy",@"zl"];
    }
    return _dataArray;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor clearColor];
        
        self.delegate = self;
        
        self.dataSource = self;
        
        self.rowHeight = 50;
        
        [self registerClass:[UITableViewCell class] forCellReuseIdentifier:@"identifier"];
        
    }
    return self;
}


-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return self.dataArray.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"identifier" forIndexPath:indexPath];
    
    [self.dataArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        
        cell.imageView.image = [UIImage imageNamed:self.dataArray[indexPath.row]];
        
        cell.textLabel.text = [NSString stringWithFormat:@"分享到%@",self.dataArray[indexPath.row]];

    }];
    
    return cell;
}

@end
